/*
 * @Author: jianglijun 
 * @Date: 2019-04-21 05:26:59 
 * @Last Modified by: jianglijun
 * @Last Modified time: 2019-04-24 22:48:39
 */

 module.exports = (options) => {
    return async (ctx, next) => {
      if (ctx.path === '/favicon.ico') return;
      const start = new Date()
      let { url } = ctx;
      ctx.url = url.startsWith("/public") ? url.replace("/public",""):url;
      if(url =="/"){ctx.url = "/music/list"}  
      await next();
      const ms = new Date() - start
      console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
    }
}